import React, { useEffect } from 'react';
import { Checkbox } from 'antd';

export default function CustomeCheckbox({
  options,
  value,
  defaultValue,
  onHandleChange,
  onChange,
  ...props
}) {
  useEffect(() => {
    onChange(value || defaultValue);
  }, []);
  const handleChange = (e) => {
    console.log(e);
    onChange(e);
    onHandleChange?.(e);
  };
  return <Checkbox checked={value} onChange={(e) => handleChange(e)} {...props} />;
}
